﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace vngoodlife.Util
{
    public static class ConstantClass
    {
        #region Image size

        /// <summary>
        /// use in ckeditor for user to upload image in comment
        /// </summary>
        public const int _uploadImageWidth = 500;

        /// <summary>
        /// use in  admin to upload article thumbnail; case : landscape
        /// </summary>
        public const int _thumbnailLandscapeWidth = 500;

        /// <summary>
        /// use in  admin to upload article thumbnail; case : portrait
        /// </summary>
        public const int _thumbnailPortraitWidth = 300;

        /// <summary>
        /// Fix Height of menulist icon
        /// </summary>
        public const int _menuListIconHeight = 30;

        /// <summary>
        /// Fix Height of avatar when upload
        /// </summary>
        public const int _memberAvatarHeight = 192;

        #endregion

        /// <summary>
        /// return dateTime format to 23/09/2012 14:09:28
        /// </summary>
        public const String _dateTimeFormat = "{0:dd/MM/yyyy HH:mm}";

        /// <summary>
        /// return dateTime format to 23/09 12:34
        /// </summary>
        public const String _partialDateTimeFormat2 = "{0:dd/MM HH:mm}";

        /// <summary>
        /// return dateTime format to 23/09 12:34
        /// </summary>
        public const String _partialDateTimeFormat = "{0:dd/MM}";

        /// <summary>
        /// Word number of comment content will appear in comment list
        /// </summary>
        public const int _commentWordNumberInList = 50;

        /// <summary>
        /// Number of character in random pass
        /// </summary>
        public const int _randomPassLength = 6;

        public const string _suffixTitle = " - Vngoodlife";

        #region cache

        public const int _ArticleCachingTime = 30;

        public const int _FunnyArticleCachingTime = 60;

        /// <summary>
        /// frontend sidebar
        /// </summary>
        public const int _ExtraArticleCachingTime = 60;

        #endregion

        #region Cookie

        //public const int cooLanguageTimeLife = 1;

        public const String cooMenuType = "cooMenuType";
        public const int cooMenuTypeTimeLife = 1;

        /// <summary>
        /// use in article list page(backend)
        /// </summary>
        public const String cooArticleTypeID = "cooArticleTypeID";

        /// <summary>
        /// hour
        /// </summary>
        public const int cooArticleTypeIDTimeLife = 2;

        /// <summary>
        /// use in article list page(backend) 
        /// </summary>
        public const String cooArticleStatusID = "cooArticleStatusID";

        /// <summary>
        /// hour
        /// </summary>
        public const int cooArticleStatusIDTimeLife = 2;

        /// <summary>
        /// use in backend for making sure of the speed of web page always stable, by specifying a default amount of record loaded each page
        /// </summary>
        public const String cooAmount = "cooAmount";
        /// <summary>
        /// default amount of record
        /// </summary>
        public const String defaultAmount = "25";
        //keep the current page value in paging
        //  public const String cooCurrentPage = "CurrentPage";

        /// <summary>
        /// hour
        /// </summary>
        public const int coodefaultAmountTimeLife = 2;


        /// <summary>
        /// Keep Page Number will show articles in Homepage
        /// </summary>
        public const string cooPageNumberOfHomePage = "cooPageNumberOfHomePage";


        /// <summary>
        /// minutes
        /// </summary>
        public const int authenCookieTimeLife = 180;

        #endregion


        #region Validate


        /// <summary>
        /// Test method name standard
        /// </summary>
        public const String testNameOfMethod = @"^([a-zA-Z_])([0-9a-zA-Z_]?)+$";

        /// <summary>
        /// Test Product Code abcde_0-1.11
        /// </summary>
        public const String testProductCode = @"^([a-zA-Z0-9])([_\.-]?[a-zA-Z0-9]){1,}$";

        /// <summary>
        /// Test Member abcde_01.11-20
        /// </summary>
        public const String testMemberNameRegular_1 = @"^([a-zA-Z])([_\.-]?[a-zA-Z0-9]){5,19}$";

        /// <summary>
        /// Test Email
        /// </summary>
        public const String testEmailRegular_1 = @"^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$";

        /// <summary>
        /// ##### or +##.#### or ###.####.###### or +###.##### or ## ## ##.##.## or (##) ##.###.##
        /// </summary>
        public const String testPhoneRegular_1 = @"^([\+]{1})?([\(]([0-9]){1,}[\)][\s]?)?([0-9]([\s\.]{1}[0-9])?)+$";

        public const String testNameRegular_1 = @"^[a-zA-Z\s]+$";

        /// <summary>
        /// dd/MM/YYY or d/M/yyyy
        /// </summary>
  
        public const String testDate_1 = @"^(((0?[1-9]|[12]\d|3[01])\/(0?[13578]|1[02])\/((1[6-9]|[2-9]\d)\d{2}))|((0?[1-9]|[12]\d|30)\/(0?[13456789]|1[012])\/((1[6-9]|[2-9]\d)\d{2}))|((0?[1-9]|1\d|2[0-8])\/0?2\/((1[6-9]|[2-9]\d)\d{2}))|(29\/0?2\/((1[6-9]|[2-9]\d)(0?[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$";

        /// <summary>
        /// Float number
        /// </summary>
        public const String testCurrencyExchangeRate = @"^[0-9]\.?[0-9]+$";

        /// <summary>
        /// Positive Integer greater than 0 (Price of produce)
        /// </summary>
        public const String testPositiveInteger = @"^(?!^0)\d{1,}$";

        /// <summary>
        /// Positive Integer include 0 - 9 number
        /// </summary>
        public const String testPositiveInteger_2 = @"^\d{1,}$";

        //Language Code
        public const String testLanguageCode = @"^([a-zA-Z]){2,2}$";

        /// <summary>
        /// Fullname include all character of Vietnam and Latin (allow a space between words)
        /// </summary>
        public const String testFullNameVietnam = @"^([aAeEoOuUiIdDyYáàạảãâấầậẩẫăắằặẳẵÁÀẠẢÃÂẤẦẬẨẪĂẮẰẶẲẴéèẹẻẽêếềệểễÉÈẸẺẼÊẾỀỆỂỄóòọỏõôốồộổỗơớờợởỡÓÒỌỎÕÔỐỒỘỔỖƠỚỜỢỞỠúùụủũưứừựửữÚÙỤỦŨƯỨỪỰỬỮíìịỉĩÍÌỊỈĨđĐýỳỵỷỹÝỲỴỶỸQqWwRrTtPpSsFfGgHhJjKkLlZzXxCcVvBbNnMm])([\s]?[aAeEoOuUiIdDyYáàạảãâấầậẩẫăắằặẳẵÁÀẠẢÃÂẤẦẬẨẪĂẮẰẶẲẴéèẹẻẽêếềệểễÉÈẸẺẼÊẾỀỆỂỄóòọỏõôốồộổỗơớờợởỡÓÒỌỎÕÔỐỒỘỔỖƠỚỜỢỞỠúùụủũưứừựửữÚÙỤỦŨƯỨỪỰỬỮíìịỉĩÍÌỊỈĨđĐýỳỵỷỹÝỲỴỶỸQqWwRrTtPpSsFfGgHhJjKkLlZzXxCcVvBbNnMm])*$";

        public const String testNon_AlphaNumberic = @"^(\W)+$";

        #endregion

        #region paging
        /// <summary>
        /// amount of article in a page, frontend article list
        /// </summary>
        public const int ArticlePageStep = 1;

        /// <summary>
        /// amount of "page button" in a page. frontend article list, odd number
        /// </summary>
        public const int ArticleBarStep = 10;

        /////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// amount of Comment in a page, frontend Comment list of a article
        /// </summary>
        public const int CommentPageStep = 10;

        /// <summary>
        /// amount of "page button" in a page. frontend Comment list, odd number
        /// </summary>
        public const int CommentBarStep = 5;

        /////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// amount of article in result. frontend article result page.
        /// </summary>
        public const int ArticleResultPageStep = 15;

        /// <summary>
        /// amount of "page button" in a page. frontend article list, odd number
        /// </summary>
        public const int ArticleResultBarStep = 5;


        /// <summary>
        /// amount of article will show in home page when clicking Show more
        /// </summary>
        public const int ArticleHomePageStep = 15;

        #endregion


        #region Role

        public static readonly List<string> roleIDListOfAdmin = new List<string> { "MRL101", "MRL103" };

        public const string superadmin = "MRL101";
        public const string member = "MRL102";
        public const string articleAdmin = "MRL103";

        public const string admin = "MRL101"+","+"MRL103";

        public const string menuAuthentication = superadmin;
        public const string articleAuthentication = superadmin + "," + articleAdmin;
        public const string subjectAuthentication = superadmin + "," + articleAdmin;
        public const string albumAuthentication = superadmin;
        public const string memberAuthentication = superadmin;

        public const string noticeAuthentication = superadmin;
        public const string commentAuthentication = superadmin + "," + articleAdmin;
        public const string pointAuthentication = superadmin;
        public const string tagAuthentication = superadmin;
        public const string giftAuthentication = superadmin;

        public const string adminAuthentication = superadmin;
        #endregion


    }
}